Skip to content

Nested sparse fields #436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 13, 2018
Merged

Conversation

milosloub
Copy link
Contributor

@milosloub milosloub commented Oct 24, 2018

Closes #434

Changed files:

  1. IQueryableExtensions - new CallGenericSelectMethod() to build Select() expression trees for requested entity, [HasOne] and [HasMany] relationships
  2. EntityResourceService - only fix to return FirstOrDefault() instead of FirstOrDefaultAsync() if fields are requested. See Query: Problems with GroupBy and nested selects dotnet/efcore#6573
  3. QueryParser - expanded to load relationship attributes and build field queries like "Owner.FirstName"
  4. SparseFieldSetTests - 3 new tests: Get all, Get one with HasOne included and Get one with HasMany included
  5. QueryParser_Tests - only new List<Relationships> in mock

@milosloub milosloub changed the title Feat/#434 Nested sparse fields Oct 24, 2018
Copy link
Contributor

@jaredcnance jaredcnance left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@@ -247,7 +247,12 @@ private async Task<TResource> GetWithRelationshipsAsync(TId id)
query = _entities.Include(query, r);
});

var value = await _entities.FirstOrDefaultAsync(query);
TEntity value;
// https://github.com/aspnet/EntityFrameworkCore/issues/6573
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Nested sparse fieldsets
2 participants